package callnumber.gtdev5.com.photoVault.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.gtdev5.geetolsdk.mylibrary.util.SpUtils;

import org.litepal.crud.DataSupport;

import callnumber.gtdev5.com.photoVault.bean.CallCustomBean;
import callnumber.gtdev5.com.photoVault.constants.AppConstans;

/**
 * Created by qp
 * PackageName FakeCall_4
 * 2018/8/20 9:34
 */

public class AlarmReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent mIntent) {
        boolean isWencall= SpUtils.getInstance().getBoolean(AppConstans.ISWENCALL,false);
          if (!isWencall){
               long sqlId=mIntent.getLongExtra(AppConstans.LONGID,0);
              Log.e("TAG",sqlId+"sqlId");
                 CallCustomBean bean= DataSupport.find(CallCustomBean.class,sqlId);
                if (bean.getIsCall()==0){
                   int wallpaperType=bean.getWallpaperType();
                   int noVipCount=SpUtils.getInstance().getInt(AppConstans.NOVIPUSECOUNT,0);
                       noVipCount+=1;
                       SpUtils.getInstance().putInt(AppConstans.NOVIPUSECOUNT,noVipCount);
                    switch (wallpaperType){
                       case 0:
                           break;
                       case 1:
//                           Intent intent1=new Intent(context, XiaomiPhoneCallActivity.class);
//                           intent1.putExtra("sqlId",sqlId);
//                           intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
//                           context.startActivity(intent1);
                           break;
                       case 2:
                           break;
                       case 3:
                           break;
                       case 4:
                           break;
                       default:
                           break;
               }

               }

           }
    }
}
